﻿<UserControl
    x:Class="SLFileManager.MainPage"
    xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"  
    xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" 
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" 
    xmlns:templ="clr-namespace:System.Windows;assembly=System.Windows.Controls"
    xmlns:mswindows="clr-namespace:Microsoft.Windows;assembly=System.Windows.Controls.Toolkit"    
    xmlns:datatoolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Toolkit"                              
    xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    xmlns:rainierPurple="clr-namespace:System.Windows.Controls.Theming;assembly=System.Windows.Controls.Theming.RainierPurple"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:converters="clr-namespace:SLFileManager.MyConverters"
    xmlns:Upload="clr-namespace:DC.FileUpload;assembly=DC.FileUpload"
    mc:Ignorable="d"  
    d:DesignWidth="1000" d:DesignHeight="500" Width="Auto" Height="Auto">
    <UserControl.Resources>
        <Style x:Key="expandedTreeViewItemStyle" TargetType="basics:TreeViewItem">
            <Setter Property="IsExpanded" Value="False" />
        </Style>
        <converters:TreeViewNodeStyleConverter x:Key="TreeViewNodeConverter" />
        <converters:ImageSourceConverter x:Key="ImageConverter" />
        <Style x:Key="styleBtnRefresh" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.1"
                                               Duration="00:00:00.25"/>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.2"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.2"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image Source="Images/refresh-purple.png" Height="30" Width="30" >
                                <Image.RenderTransform>
                                    <ScaleTransform x:Name="Img"/>
                                </Image.RenderTransform>
                                <ToolTipService.ToolTip>
                                    <ToolTip>
                                        <TextBlock Text="refresh" />
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                            </Image>
                            <ContentPresenter HorizontalAlignment="Right"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="styleBtnUpload" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.1"
                                               Duration="00:00:00.25"/>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.2"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.2"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image Source="Images/upload-purple.png" Height="30" Width="30" >
                                <Image.RenderTransform>
                                    <ScaleTransform x:Name="Img"/>
                                </Image.RenderTransform>
                                <ToolTipService.ToolTip>
                                    <ToolTip>
                                        <TextBlock Text="Upload" />
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                            </Image>
                            <ContentPresenter HorizontalAlignment="Right"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="styleBtnDeleteFolder" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.1"
                                               Duration="00:00:00.25"/>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.2"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.2"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image Source="Images/delete-purple.png" Height="30" Width="30" >
                                <Image.RenderTransform>
                                    <ScaleTransform x:Name="Img"/>
                                </Image.RenderTransform>
                                <ToolTipService.ToolTip>
                                    <ToolTip>
                                        <TextBlock Text="Delete folder" />
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                            </Image>
                            <ContentPresenter HorizontalAlignment="Right"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="styleBtnRenameFolder" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.1"
                                               Duration="00:00:00.25"/>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.2"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.2"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image Source="Images/rename-purple.png" Height="30" Width="30" >
                                <Image.RenderTransform>
                                    <ScaleTransform x:Name="Img"/>
                                </Image.RenderTransform>
                                <ToolTipService.ToolTip>
                                    <ToolTip>
                                        <TextBlock Text="Naam wijzigen folder" />
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                            </Image>
                            <ContentPresenter HorizontalAlignment="Right"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="styleBtnAddFolder" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.1"
                                               Duration="00:00:00.25"/>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.2"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.2"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image Source="Images/add-folder-purple.png" Height="30" Width="30" >
                                <Image.RenderTransform>
                                    <ScaleTransform x:Name="Img"/>
                                </Image.RenderTransform>
                                <ToolTipService.ToolTip>
                                    <ToolTip>
                                        <TextBlock Text="Map toevoegen" />
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                            </Image>
                            <ContentPresenter HorizontalAlignment="Right"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="styleBtnExpand" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Margin="3">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.1"
                                               Duration="00:00:00.25"/>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.2"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.2"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image Source="Images/expand.png" Height="16" Width="16" >
                                <Image.RenderTransform>
                                    <ScaleTransform x:Name="Img"/>
                                </Image.RenderTransform>
                                <ToolTipService.ToolTip>
                                    <ToolTip>
                                        <TextBlock Text="Alles uitklappen" />
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                            </Image>
                            <ContentPresenter HorizontalAlignment="Right"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="styleBtnCollapse" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.1"
                                               Duration="00:00:00.25"/>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.1"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleX" To="1.2"
                                               Duration="00:00:00.25" />
                                            <DoubleAnimation Storyboard.TargetName="Img"
                                               Storyboard.TargetProperty="ScaleY" To="1.2"
                                               Duration="00:00:00.25" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image Source="Images/collapse.png" Height="16" Width="16" >
                                <Image.RenderTransform>
                                    <ScaleTransform x:Name="Img"/>
                                </Image.RenderTransform>
                                <ToolTipService.ToolTip>
                                    <ToolTip>
                                        <TextBlock Text="Alles inklappen" />
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                            </Image>
                            <ContentPresenter HorizontalAlignment="Right"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <rainierPurple:RainierPurpleTheme>
        <Grid x:Name="LayoutRoot" Background="White" >
            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition />
                <RowDefinition Height="30"/>
            </Grid.RowDefinitions>
            <TextBlock x:Name="Title" Grid.Row="0" HorizontalAlignment="Center" Foreground="Black" FontSize="25" Text="Server Filemanager"/>
            <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Left">
                <Button x:Name="BtnRefresh" Width="30" Click="BtnRefresh_Click" Style="{StaticResource styleBtnRefresh}" />
                <Button x:Name="BtnDeleteFolder" Width="30" Click="BtnDeleteFolder_Click" Style="{StaticResource styleBtnDeleteFolder}" />
                <Button x:Name="BtnRenameFolder" Width="30" Click="BtnRenameFolder_Click" Style="{StaticResource styleBtnRenameFolder}" />
                <Button x:Name="BtnAddFolder" Width="30" Click="BtnAddFolder_Click" Style="{StaticResource styleBtnAddFolder}" />
                <Button x:Name="BtnUpload" Width="30" Click="BtnUpload_Click" Style="{StaticResource styleBtnUpload}" />
                <Popup x:Name="PopupUpload" IsOpen="False" >
                    <Grid Height="400" Width="600">
                        <Upload:FileUploadControl x:Name="FileUploadCtrl" MaxConcurrentUploads="10" Multiselect="True" />
                        <Button x:Name="BtnCloseUpload" Width="40" Height="30" Click="BtnCloseUpload_Click" Content="Close" VerticalAlignment="Top" HorizontalAlignment="Right" />
                    </Grid>
                </Popup>
                <Popup x:Name="PopupFolderName" IsOpen="False" >
                    <Grid Height="50" Width="300">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                            <TextBox x:Name="TbFolderName" Width="200" Height="30"/>
                            <Button x:Name="BtnFolderNameOK" Width="30" Height="30" Click="BtnFolderNameOK_Click" Content="OK" />
                        </StackPanel>
                    </Grid>
                </Popup>
                <Popup x:Name="PopupAddFolder" IsOpen="False" >
                    <Grid Height="50" Width="300">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                            <TextBox x:Name="TbAddFolder" Width="200" Height="30"/>
                            <Button x:Name="BtnAddFolderOK" Width="30" Height="30" Click="BtnAddFolderOK_Click" Content="OK" />
                        </StackPanel>
                    </Grid>
                </Popup>
            </StackPanel>
            <Grid x:Name="GridContent" Grid.Row="2" HorizontalAlignment="Left" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="24"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Button Click="ExpandAll" Grid.Row="0" Grid.Column="0" Style="{StaticResource styleBtnExpand}" HorizontalAlignment="Right"/>
                        <Button Click="CollapseAll" Grid.Row="0" Grid.Column="1" Style="{StaticResource styleBtnCollapse}" HorizontalAlignment="Left"/>                       
                        <toolkit:TreeViewDragDropTarget x:Name="TVDragDrop" AllowDrop="true" Grid.Row="1" Grid.ColumnSpan="2"
                                                HorizontalAlignment="Stretch"  VerticalAlignment="Top">
                            <basics:TreeView x:Name="TVFolders" ItemContainerStyle="{StaticResource expandedTreeViewItemStyle}"
                            Background="WhiteSmoke" Foreground="DarkMagenta" HorizontalAlignment="Left"  VerticalAlignment="Top" >
                                <basics:TreeView.ItemTemplate>
                                    <templ:HierarchicalDataTemplate  ItemsSource="{Binding _SubFolders}">
                                        <TextBlock Text="{Binding _FolderName}" Margin="5,0"
                                           Style="{Binding _Files, Converter={StaticResource TreeViewNodeConverter}}" />
                                    </templ:HierarchicalDataTemplate>
                                </basics:TreeView.ItemTemplate>
                            </basics:TreeView>

                        </toolkit:TreeViewDragDropTarget>
                    </Grid>
                <basics:GridSplitter x:Name="grsplSplitter" Grid.Column="1" Width="5"
                             VerticalAlignment="Stretch" HorizontalAlignment="Center" />
                <datatoolkit:DataGridDragDropTarget x:Name="DGDragDrop" AllowDrop="false" Grid.Column="2" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                    <data:DataGrid x:Name="DGfiles" AutoGenerateColumns="false" CanUserResizeColumns="True" 
                               Background="WhiteSmoke" Foreground="DarkMagenta" HorizontalContentAlignment="Stretch">
                        <data:DataGrid.Columns>
                            <data:DataGridTemplateColumn Header="Acties" CanUserSort="False" CanUserReorder="False" >
                                <data:DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal" Height="20" Width="Auto">
                                            <Button x:Name="btnSelect" Loaded="btnSelect_Loaded" Click="btnSelect_Click" Content="Select" UseLayoutRounding="True" />
                                            <Button x:Name="btnDelete" Click="btnDelete_Click" Content="Delete" UseLayoutRounding="True" />
                                            <!--<Button x:Name="btnUpdate" Click="btnUpdate_Click" Content="Save" UseLayoutRounding="True" />-->
                                        </StackPanel>
                                    </DataTemplate>
                                </data:DataGridTemplateColumn.CellTemplate>
                            </data:DataGridTemplateColumn>
                            <data:DataGridTemplateColumn Header="Image" IsReadOnly="True">
                                <data:DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Image Width="50" Height="50" Source="{Binding Converter={StaticResource ImageConverter}}" Stretch="Fill" ImageFailed="img_ImageFailed">
                                            <ToolTipService.ToolTip>
                                                <ToolTip>
                                                    <Image Source="{Binding Converter={StaticResource ImageConverter}}" Width="400" Height="400" />
                                                </ToolTip>
                                            </ToolTipService.ToolTip>
                                        </Image>
                                    </DataTemplate>
                                </data:DataGridTemplateColumn.CellTemplate>
                            </data:DataGridTemplateColumn>
                            <data:DataGridTextColumn Header="Name" Binding="{Binding _FileName}" Width="150" IsReadOnly="False"/>
                            <data:DataGridTextColumn Header="Modified" Binding="{Binding _ModifiedDate}" Width="150" IsReadOnly="True"/>
                            <data:DataGridTextColumn Header="Size" Binding="{Binding _Size}" Width="100" IsReadOnly="True" />
                        </data:DataGrid.Columns>
                        <!--<data:DataGridTextColumn Header="Created" Binding="{Binding _CreationDate}" Width="150" IsReadOnly="True" />
                    <data:DataGridTextColumn Header="ID" Binding="{Binding _FileID}" Width="100" IsReadOnly="True" />
                    <data:DataGridTextColumn Header="Full path" Binding="{Binding _FullPath}" Width="200" IsReadOnly="True" />-->
                    </data:DataGrid>
                </datatoolkit:DataGridDragDropTarget>
            </Grid>
            <StackPanel Orientation="Horizontal" Grid.Row="3" HorizontalAlignment="Left">
                <TextBlock x:Name="Status" Foreground="red" FontSize="15" FontWeight="Bold" />
                <TextBlock x:Name="PathTitle" Foreground="Black" FontSize="15" FontWeight="Bold" Text="Path: " />
                <TextBlock x:Name="Path" Foreground="DarkMagenta" FontSize="15" >
                    <ToolTipService.ToolTip>
                         <ToolTip>
                            <TextBlock x:Name="PathTooltip"/>
                         </ToolTip>
                    </ToolTipService.ToolTip>
                </TextBlock>
            </StackPanel>
        </Grid>
    </rainierPurple:RainierPurpleTheme>
</UserControl>